﻿using System;
using System.Collections;
using System.Collections.Generic;

namespace ALinq.BBS.DataAccess
{
    public class PostList : IEnumerable<Post>
    {
        private readonly IEnumerable<Post> items;

        public PostList(Posts posts, IEnumerable<Post> items, int pageIndex = 0)
        {
            //this.Forum = forum;
            this.items = items;
            this.Index = pageIndex;
            Posts = posts;
        }

        //public Forum Forum { get; internal set; }

        public IEnumerator<Post> GetEnumerator()
        {
            return this.items.GetEnumerator();
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }

        public int Index { get; private set; }

        public Posts Posts
        {
            get;
            private set;
        }

    }
}